package com.java.comprehensive.design.building_modelling.singleton_pattern;

/**
 * 单例：懒汉式
 */
public class SingletonDemo_3 {
    private SingletonDemo_3() {
    }

    private static SingletonDemo_3 instance;

    public static synchronized SingletonDemo_3 getInstance() {
        if (instance == null) {
            instance = new SingletonDemo_3();
        }
        return instance;
    }

}
